package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the TRAININGGACTIVITIES database table.
 * 
 */
@Entity
@Table(name="TRAININGGACTIVITIES")
@NamedQuery(name="Traininggactivity.findAll", query="SELECT t FROM Traininggactivity t")
public class Traininggactivity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="TRAININGGACTIVITIES_TRAININGID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="TRAININGGACTIVITIES_TRAININGID_GENERATOR")
	@Column(name="TRAINING_ID")
	private long trainingId;

	@Column(name="CERTIFICATE_REMARKS")
	private String certificateRemarks;

	@Column(name="TRAINING_AGENDANUMBER")
	private BigDecimal trainingAgendanumber;

	@Column(name="TRAINING_BUDGET")
	private BigDecimal trainingBudget;

	@Column(name="TRAINING_ENDTIME")
	private Timestamp trainingEndtime;

	@Column(name="TRAINING_LOCATION")
	private String trainingLocation;

	@Column(name="TRAINING_NAME")
	private String trainingName;

	@Column(name="TRAINING_NUMBEROFCOURSES")
	private BigDecimal trainingNumberofcourses;

	@Column(name="TRAINING_NUMBEROFPARTICIPANTS")
	private BigDecimal trainingNumberofparticipants;

	@Column(name="TRAINING_STARTTIME")
	private Timestamp trainingStarttime;

	@Column(name="TRAINING_STATE")
	private BigDecimal trainingState;

	//bi-directional many-to-one association to Coursearrangement
	@OneToMany(mappedBy="traininggactivity")
	@JSONField(serialize=false)
	private List<Coursearrangement> coursearrangements;

	public Traininggactivity() {
	}

	public long getTrainingId() {
		return this.trainingId;
	}

	public void setTrainingId(long trainingId) {
		this.trainingId = trainingId;
	}

	public String getCertificateRemarks() {
		return this.certificateRemarks;
	}

	public void setCertificateRemarks(String certificateRemarks) {
		this.certificateRemarks = certificateRemarks;
	}

	public BigDecimal getTrainingAgendanumber() {
		return this.trainingAgendanumber;
	}

	public void setTrainingAgendanumber(BigDecimal trainingAgendanumber) {
		this.trainingAgendanumber = trainingAgendanumber;
	}

	public BigDecimal getTrainingBudget() {
		return this.trainingBudget;
	}

	public void setTrainingBudget(BigDecimal trainingBudget) {
		this.trainingBudget = trainingBudget;
	}

	public Timestamp getTrainingEndtime() {
		return this.trainingEndtime;
	}

	public void setTrainingEndtime(Timestamp trainingEndtime) {
		this.trainingEndtime = trainingEndtime;
	}

	public String getTrainingLocation() {
		return this.trainingLocation;
	}

	public void setTrainingLocation(String trainingLocation) {
		this.trainingLocation = trainingLocation;
	}

	public String getTrainingName() {
		return this.trainingName;
	}

	public void setTrainingName(String trainingName) {
		this.trainingName = trainingName;
	}

	public BigDecimal getTrainingNumberofcourses() {
		return this.trainingNumberofcourses;
	}

	public void setTrainingNumberofcourses(BigDecimal trainingNumberofcourses) {
		this.trainingNumberofcourses = trainingNumberofcourses;
	}

	public BigDecimal getTrainingNumberofparticipants() {
		return this.trainingNumberofparticipants;
	}

	public void setTrainingNumberofparticipants(BigDecimal trainingNumberofparticipants) {
		this.trainingNumberofparticipants = trainingNumberofparticipants;
	}

	public Timestamp getTrainingStarttime() {
		return this.trainingStarttime;
	}

	public void setTrainingStarttime(Timestamp trainingStarttime) {
		this.trainingStarttime = trainingStarttime;
	}

	public BigDecimal getTrainingState() {
		return this.trainingState;
	}

	public void setTrainingState(BigDecimal trainingState) {
		this.trainingState = trainingState;
	}

	public List<Coursearrangement> getCoursearrangements() {
		return this.coursearrangements;
	}

	public void setCoursearrangements(List<Coursearrangement> coursearrangements) {
		this.coursearrangements = coursearrangements;
	}

	public Coursearrangement addCoursearrangement(Coursearrangement coursearrangement) {
		getCoursearrangements().add(coursearrangement);
		coursearrangement.setTraininggactivity(this);

		return coursearrangement;
	}

	public Coursearrangement removeCoursearrangement(Coursearrangement coursearrangement) {
		getCoursearrangements().remove(coursearrangement);
		coursearrangement.setTraininggactivity(null);

		return coursearrangement;
	}

}